package com.zzuli.dcxt.controller;

import com.zzuli.dcxt.entiy.Category;
import com.zzuli.dcxt.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
@RequestMapping("/category")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;
    @RequestMapping("/select")
    public String selectAll(HttpSession session){
     List<Category> categoryList=categoryService.selectAll();
     session.setAttribute("categoryList",categoryList);
     return "/admin/categoryList";
    }

}
